home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Singles Flirt Up Your Life! (German)
/
Singles Flirt Up Your Life.iso
/
data1.cab
/
Statemachine
/
poolChar.lua
< prev
next >
Wrap
Text File
|
2004-01-29
|
3KB
|
136 lines
-- pool character state machine
beginStateMachine()
onEnter(function(msg)
print("poolChar enter ------------------------------------------");
local pool = getStateObjectFromID(msg.sender)
storeStateObject("pool", pool);
end )
onExit(function(msg)
print("poolChar exit ------------------------------------------ queue:" .. getParent().getActivityQueueCount());
-- local pool = retrieveStateObject("pool");
-- getParent().unlockActionPoints(pool);
-- getParent().stopAllActivities(pool);
-- removeStateObject("pool");
unlockAll("pool");
end )
state("sitDown")
onEnter(function(msg)
--local currentOutfit = getParent().getOutfit();
if (hasOutfit(getParent(), SWIMMING)) then
startAnimation("poolSitDown");
else
setState("undress");
end
end )
onMsg("end", function(msg)
setCurrentPosition();
if testCancel() then
setState("getUp")
else
setState("enter")
end
end )
state("undress")
onEnter(function(msg)
--startAnimation("ausziehen2");
startAnimation(getChangeOutfitAnim(getParent()));
sendDelayedMsgThis("underwear", 1600);
end )
onMsg("underwear", function(msg)
changeOutfit(getParent(), SWIMMING);
end )
onMsg("end", function(msg)
setState("sitDown")
end )
state("enter")
onEnter(function(msg)
print("enter");
startAnimation("poolGetIn");
getParent().enableBlobShadow(false);
end )
onMsg("end", function(msg)
getParent().playSound("splashSoft");
if testCancel() then
setCurrentPosition();
flipPoseDirection();
setState("exit")
else
local pool = retrieveStateObject("pool")
setCurrentPosition();
flipPoseDirection();
enterStateMachine("swimChar.stand");
-- start the swimming activity
getParent().startActivity("swim", pool);
nextAction();
-- storeStateObject("pool", pool);
end
end )
onReturn(function(msg)
setState("exit");
end )
state("exit")
onEnter(function(msg)
print("exit");
-- replace the current entry in the activity queue by a replace pool action
local character = this.getParent();
local pool = retrieveStateObject("pool");
--character.replaceQueueEntry(0, "pm_exitPool");
-- stop the activity
getParent().stopActivity("swim", pool);
flipPoseDirection();
getParent().playSound("splashSoft");
startAnimation("poolGetOut");
end )
onMsg("end", function(msg)
setCurrentPosition();
getParent().enableBlobShadow(true);
setState("getUp");
end )
state("getUp")
onEnter(function(msg)
print("getUp");
startAnimation("poolStandUp");
end )
onMsg("end", function(msg)
setCurrentPosition();
exitStateMachine();
--exitAndGoAway();
end )
endStateMachine()